package snafu.framework.actions;

import java.util.List;

import snafu.framework.agents.AgentState;
import snafu.framework.objects.WorldObject;
import snafu.framework.worlds.WorldMap;

public interface Intention<A extends AbstractAction> {

	/**
	 * Creates the action belonging to this intention with the given targets.
	 * 
	 * @param targets
	 *            the list of targets
	 * @return an action, {@link EmptyAction} for idle action
	 */
	public A createAction(List<WorldObject> targets);
	
	/**
	 * Same as above but with an array of objects or comma separated objects.
	 * 
	 * @param targets
	 *            the objects, may be empty
	 * @return an action, {@link EmptyAction} for idle action
	 */
	public A createAction(WorldObject... targets);

	/**
	 * Indicates whether the action created by this intention is applicable given the current state
	 * of the world the state of the agent and the list of targets for the action.
	 * 
	 * @param perception
	 *            the world
	 * @param agent
	 *            the agent state
	 * @param targets
	 *            the targets
	 * @return true if the action is applicable
	 */
	public boolean isApplicable(WorldMap perception, AgentState agent, List<WorldObject> targets);
	
	/**
	 * Same as above but with an array of objects or comma seperated objects.
	 * 
	 * @param perception
	 *            the world
	 * @param agent
	 *            the agent state
	 * @param targets
	 *            the targets
	 * @return true if the action is applicable
	 */
	public boolean isApplicable(WorldMap perception, AgentState agent, WorldObject... targets);
	
}
